<template>
  <div class="center-view">
    <div class="avatar">
      <img alt="头像" src="../../public/avatar.png">
      <div class="nick-name">立即登录</div>
    </div>
    <ul class="my-order-tab">
      <li>
        <svg aria-hidden="true" class="icon">
          <use xlink:href="#icon-dingdan"></use>
        </svg>
        <div class="common-p">电影点单</div>
      </li>
      <li>
        <svg aria-hidden="true" class="icon">
          <use xlink:href="#icon-biaoqiankuozhan_dingdan-314"></use>
        </svg>
        <div class="common-p">商品订单</div>
      </li>
    </ul>
    <van-cell class="my-card">
      <template #title>
        <span class="custom-title">卖座券</span>
      </template>
      <template #icon>
        <svg aria-hidden="true" class="icon">
          <use xlink:href="#icon-kaquan"></use>
        </svg>
      </template>
      <!-- 使用 right-icon 插槽来自定义右侧图标 -->
      <template #right-icon>
        <van-icon name="arrow"/>
      </template>
    </van-cell>
    <van-cell class="my-envelop">
      <template #title>
        <span class="custom-title">组合红包</span>
      </template>
      <template #icon>
        <svg aria-hidden="true" class="icon">
          <use xlink:href="#icon-iconfront-"></use>
        </svg>
      </template>
      <!-- 使用 right-icon 插槽来自定义右侧图标 -->
      <template #right-icon>
        <van-icon name="arrow"/>
      </template>
    </van-cell>
    <van-cell class="my-balance">
      <template #title>
        <span class="custom-title">余额</span>
      </template>
      <template #icon>
        <svg aria-hidden="true" class="icon">
          <use xlink:href="#icon-yue"></use>
        </svg>
      </template>
      <!-- 使用 right-icon 插槽来自定义右侧图标 -->
      <template #right-icon>
        <van-icon name="arrow"/>
      </template>
    </van-cell>
    <van-cell class="system-set">
      <template #title>
        <span class="custom-title">设置</span>
      </template>
      <template #icon>
        <svg aria-hidden="true" class="icon">
          <use xlink:href="#icon-shezhi"></use>
        </svg>
      </template>
      <!-- 使用 right-icon 插槽来自定义右侧图标 -->
      <template #right-icon>
        <van-icon name="arrow"/>
      </template>
    </van-cell>
  </div>
</template>

<script>
import Vue from 'vue'
import { Cell, Icon } from 'vant'

Vue.use(Cell).use(Icon)
export default {
  name: 'Center'
  // 局部路由拦截，或者叫组件内的路由拦截
  // beforeRouteEnter() {
  //
  // }
}
</script>

<style lang="scss" scoped>
.avatar {
  background: url("../../public/bg.png");
  display: flex;
  justify-content: flex-start;
  align-items: center;
  height: 40vw;
  background-size: cover;

  img {
    width: 63px;
    height: 63px;
    border-radius: 35px;
    margin-right: 20px;
    border: 2px solid #fff;
    margin-left: 22px;
  }

  .nick-name {
    color: #ffffff;
  }
}

.my-order-tab {
  display: flex;
  justify-content: space-around;
  margin-bottom: 10px;
  background-color: #fff;
  height: 21.07vw;

  li {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    svg {
      width: 26px;
      height: 26px;
    }

    .common-p {
      margin-top: 5px;
      font-size: 13px;
      color: #797d82;
    }
  }
}

.custom-title {
  margin-left: 15px;
}

.my-envelop svg {
  fill: #b2a27b;
}

.my-card svg {
  fill: #e18360;
}

.my-balance svg {
  fill: #efc974;
}

.system-set svg {
  fill: #becb56;
}

.icon {
  width: 6vw;
  height: 6vw;
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
}
</style>
